import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: ()=>import('@/views/home/home.vue'),
    redirect:'/home/recommend',
    children: [
      {
        path: '/home/recommend',
        name: 'homerecommend',
        component: ()=>import('@/views/home/components/recommend.vue')
      },
      {
        path: '/home/mine',
        name: 'homemine',
        component: ()=>import('@/views/home/components/mine.vue')
      }
    ]
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/index.vue')
  },
  {
    path: '/musiclist',
    name: 'musiclist',
    component: () => import('@/views/musiclist/index.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
